package com.xuecheng.framework.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * @Description 页面类型枚举
 * @author ShengJinFeng
 * @date 2020/1/19
 */
public enum PageTypeEnum {

    STATIC_STATE("0","静态"),
    DYNAMIC_STATE("1","动态");

    private final String key;
    private final String value;

    private PageTypeEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public PageTypeEnum getByKey(String key){
        PageTypeEnum[] types = PageTypeEnum.values();
        for (PageTypeEnum type : types) {
            if (StringUtils.equals(type.getKey(),key)){
                return type;
            }
        }
        return null;
    }

    public String getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }
}
